﻿namespace DCHealthCheck.MvcWeb.Controllers {

    #region Usings
    using DCHealthCheck.DomainModel;
    using DCHealthCheck.MvcWeb.Classes;
    using DCHealthCheck.MvcWeb.Classes.DataServices;
    using DCHealthCheck.MvcWeb.Classes.ViewModels;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    #endregion

    public class ProductsController : BaseController {

        private readonly IProductsDataService ProductsDataService;

        public ProductsController(IProductsDataService productsDataService) {
            if (productsDataService == null) {
                throw new ArgumentNullException("productsDataService");
            }
            this.ControllerName = "Products";
            this.ProductsDataService = productsDataService;
        }

        public ActionResult Index(ProductsViewModel viewModel) {
            this.ProductsDataService.ProcessData(viewModel);
            return View(viewModel);
        }
    }
}
